package com.itmumu.miniwechat.common.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Description: 通用异常码
 * Author: <a href="https://github.com/zongzibinbin">abin</a>
 * Date: 2023-03-26
 */
@AllArgsConstructor
@Getter
public enum CommonErrorEnum implements ErrorEnum {

    SUCCESS(0, "请求成功"),
    SYSTEM_ERROR(-1, "系统出小差了，请稍后再试哦~~"),
    PARAM_VALID(40001, "参数校验失败{0}"),
    FREQUENCY_LIMIT(40002, "请求太频繁了，请稍后再试哦~~"),
    LOCK_LIMIT(40003, "请求太频繁了，请稍后再试哦~~"),
    UNAUTHORIZED(40101, "未授权，请先登录"),
    ;
    private final Integer code;
    private final String msg;

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.msg;
    }
}
